#不同字符串
s = '0100110001010001'
# s = 'aaab'
sep = 1  # 连续的sep个字符的子串
count = 0
set1 = set()  # 空集合，利用集合的不重复性
while sep <= len(s):
    set1.add(s[0:sep])
    for i in range(len(s) - sep):
        set1.add(s[i+1:i+sep+1])  # 集合自动去掉重复的
    sep += 1
    count += len(set1)  # 去重后的个数
    print(set1)
    set1.clear()
print(count)